package com.VolunteerPlatform.Service.AdminService.impl;

import com.VolunteerPlatform.Dao.AdminLoginDao;
import com.VolunteerPlatform.Entity.AdminInfo;
import com.VolunteerPlatform.Service.AdminService.AdminInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by DoveXL on 2018/12/4.
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AdminInfoServiceImpl implements AdminInfoService{
    @Autowired
    private AdminLoginDao adminLoginDao;


    public AdminInfo getAdminLoginService(String UserName, String Password, String UserStatus)
    {
        return adminLoginDao.getAdminLogin(UserName,Password,UserStatus);
    }
    public int updateAdminInfoService(String UserName,String RealName,String Password,String UserStatus)
    {
        return  adminLoginDao.updateAdminInfo(UserName,RealName,Password,UserStatus);
    }
    public int insertAdminInfoService(String UserName,String RealName,String Password,String UserStatus)
    {
        return adminLoginDao.insertAdminInfo(UserName,RealName,Password,UserStatus);
    }
    public AdminInfo findAdminByNameService(String UserName)
    {
        return  adminLoginDao.findAdminByName(UserName);
    }


    public List<AdminInfo> getAllAdminInfoService(String UserName, String Password, String UserStatus,int Page,int PageList)
    {
        return adminLoginDao.getAllAdminInfo(UserName,Password,UserStatus,Page,PageList);
    }
}
